﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterAdmin.master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="Project_Udrinkwater.PagesAdmin.Register" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="HeaderText">ลงทะเบียนพนักงาน</div>
    <table style="width:100%;">
        <tr>
            <td style="width: 291px; text-align: right;">
                รหัสพนักงาน :</td>
            <td style="width: 238px">
                <dx:ASPxTextBox ID="txtID" runat="server" Width="170px">
                    <ValidationSettings ValidationGroup="RegisterUserValidationGroup">
                        <RequiredField ErrorText="กรุณากรอกข้อมูล" IsRequired="true" />
                    </ValidationSettings>
                </dx:ASPxTextBox>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                &nbsp;</td>
            <td style="width: 238px">
                <asp:Button ID="Button2" runat="server" onclick="Button2_Click" 
                    Text="ตรวจสอบ" /><asp:Label ID="Label1" runat="server"></asp:Label>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                รหัสผ่าน :</td>
            <td style="width: 238px">
                <dx:ASPxTextBox ID="txtPass" runat="server" Password="True" Width="170px">
                    <ValidationSettings ValidationGroup="RegisterUserValidationGroup">
                        <RequiredField ErrorText="กรุณากรอกข้อมูล" IsRequired="true" />
                    </ValidationSettings>
                </dx:ASPxTextBox>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                คำนำหน้า :</td>
            <td style="width: 238px">
                <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
                    <asp:ListItem>นาย</asp:ListItem>
                    <asp:ListItem>นาง</asp:ListItem>
                    <asp:ListItem>นางสาว</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="height: 23px; width: 291px; text-align: right;">
                ชื่อ :</td>
            <td style="height: 23px; width: 238px">
                <dx:ASPxTextBox ID="txtFname" runat="server" Width="170px">
                    <ValidationSettings ValidationGroup="RegisterUserValidationGroup">
                        <RequiredField ErrorText="กรุณากรอกข้อมูล" IsRequired="true" />
                    </ValidationSettings>
                </dx:ASPxTextBox>
            </td>
            <td style="height: 23px">
                &nbsp;</td>
            <td style="height: 23px">
            </td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                นามสกุล :</td>
            <td style="width: 238px">
                <dx:ASPxTextBox ID="txtLname" runat="server" Width="170px">
                    <ValidationSettings ValidationGroup="RegisterUserValidationGroup">
                        <RequiredField ErrorText="กรุณากรอกข้อมูล" IsRequired="true" />
                    </ValidationSettings>
                </dx:ASPxTextBox>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                บ้านเลขที่ / หมู :
            </td>
            <td style="width: 238px">
                <dx:ASPxTextBox ID="txtAdress" runat="server" Width="170px">
                    <ValidationSettings ValidationGroup="RegisterUserValidationGroup">
                        <RequiredField ErrorText="กรุณากรอกข้อมูล" IsRequired="true" />
                    </ValidationSettings>
                </dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                จังหวัด :
            </td>
            <td style="width: 238px">
                <asp:DropDownList ID="ddlProvince" runat="server" AutoPostBack="True" DataSourceID="SqlDataProvince"
                    DataTextField="PROVINCE_NAME" DataValueField="PROVINCE_ID" 
                    OnSelectedIndexChanged="ddlProvince_SelectedIndexChanged" Width="170px">
                </asp:DropDownList>
                </td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                อำเภอ :
            </td>
            <td style="width: 238px">
                <asp:DropDownList ID="ddlAmphur" runat="server" AutoPostBack="True" DataSourceID="SqlDataAmphur"
                    DataTextField="AMPHUR_NAME" DataValueField="AMPHUR_ID" 
                    OnSelectedIndexChanged="ddlAmphur_SelectedIndexChanged" Width="170px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                ตำบล :
            </td>
            <td style="width: 238px">
                <asp:DropDownList ID="ddlDistrict" runat="server" AutoPostBack="True" DataSourceID="SqlDataDistrict"
                    DataTextField="DISTRICT_NAME" DataValueField="DISTRICT_ID" Width="170px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                เบอร์โทรศัพท์ :</td>
            <td style="width: 238px">
                <dx:ASPxTextBox ID="txtPhone" runat="server" Width="170px">
                </dx:ASPxTextBox>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                ตำแหน่ง :</td>
            <td style="width: 238px">
                <asp:DropDownList ID="ddlJob" runat="server" AutoPostBack="True" 
                    DataSourceID="dsDepartmentID" DataTextField="Department_Name" 
                    DataValueField="Department_ID" Width="170px">
                </asp:DropDownList>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                วันที่เริ่มทำงาน: </td>
            <td style="width: 238px">
                <dx:ASPxDateEdit ID="ASPxDateEdit1" runat="server">
                </dx:ASPxDateEdit>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                เงินเดือน: </td>
            <td style="width: 238px">
                <dx:ASPxTextBox ID="txtSa" runat="server" Width="170px">
                </dx:ASPxTextBox>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                &nbsp;</td>
            <td style="width: 238px">
                <dx:ASPxButton ID="bt_Register" runat="server" onclick="ASPxButton1_Click" ValidationGroup="RegisterUserValidationGroup"
                    Text="ลงทะเบียน" Theme="Office2003Blue" Width="86px">
                </dx:ASPxButton>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 291px; text-align: right;">
                &nbsp;</td>
            <td style="width: 238px">
                &nbsp;</td>
            <td>
                <asp:SqlDataSource ID="dsDepartmentID" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:DB_UdrinkConnectionString %>" 
                    SelectCommand="SELECT Department_ID, Department_Name FROM TB_Department">
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataProvince" runat="server" ConnectionString="<%$ ConnectionStrings:DB_UdrinkConnectionString %>"
                    
                    SelectCommand="SELECT [PROVINCE_ID], [PROVINCE_NAME] FROM [TB_Province] ORDER BY [PROVINCE_NAME]"></asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataAmphur" runat="server" ConnectionString="<%$ ConnectionStrings:DB_UdrinkConnectionString %>"
                    
                    SelectCommand="SELECT [AMPHUR_ID], [AMPHUR_NAME], [PROVINCE_ID] FROM [TB_Amphur] WHERE ([PROVINCE_ID] = @PROVINCE_ID) ORDER BY [AMPHUR_NAME]">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddlProvince" Name="PROVINCE_ID" PropertyName="SelectedValue"
                            Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataDistrict" runat="server" ConnectionString="<%$ ConnectionStrings:DB_UdrinkConnectionString %>"
                    
                    SelectCommand="SELECT DISTRICT_ID, DISTRICT_NAME, AMPHUR_ID, PROVINCE_ID FROM TB_District WHERE (PROVINCE_ID = @PROVINCE_ID) AND (AMPHUR_ID = @AMPHUR_ID) ORDER BY DISTRICT_NAME">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddlProvince" Name="PROVINCE_ID" PropertyName="SelectedValue"
                            Type="Int32" />
                        <asp:ControlParameter ControlID="ddlAmphur" Name="AMPHUR_ID" PropertyName="SelectedValue"
                            Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
